import pytest
from selenium import webdriver

from common.mysql_tools import connect, excute, disconnect


@pytest.fixture(scope="session")
def db_clean():
    conn = connect()
    excute(conn, "delete from sys_user where account like 'test% ")
    yield
    disconnect(conn)

@pytest.fixture()
def get_driver(db_clean):
    driver =webdriver.Chrome()
    driver.get("http://localhost/ranzhi/www")
    driver.maximize_window()
    yield driver
    driver.quit()